<div class="onecolumn" >
                        <div class="header"> <span ><span class="ico gray notepad"></span><?php echo Yii::app()->name;?> - Contacts</span> </div>
                        <div class="clear"></div>
<div class="content" >
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl?>/admin_assets/js/checkboxes_operation.js"></script>
<script>
$(document).ready(function(){
	$('table.dataTable').prop('id','user_table');
	$('#contact_all').addClass('checkAll');
	$('.checkAll,.chkbox').customInput();
});
</script>

<?php $this->renderPartial('_search', array('model'=>$model));?>

<form action="<?php echo Yii::app()->getBaseUrl()?>/admin/contact/process" method="post" id="contact" name="contact">
<input type="hidden" name="pageAction" id="pageAction" />
<?php 

	$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'userTable',
	'dataProvider'=>$model->search(),
	'enableSorting'=>'true',
	'summaryText'=>'',
	'ajaxUpdate'=>false,
	'itemsCssClass'=>'sortTable display dataTable',
	'pager'=>array(
			'header'=>false,
			'firstPageLabel' => 'First',
			'prevPageLabel' => 'Previous',
			'nextPageLabel' => 'Next',
			'lastPageLabel' => 'Last',
			),
	'columns'=>array(
			array(
					'name' =>'contact[]',
					'class'=>'CCheckBoxColumn',
					'selectableRows'=>2,
					'id'=>'contact',
					'value'=>'$data->id',
					'checkBoxHtmlOptions'=>array('class'=>'chkbox'),
			),
			array(            
					'name'=>'name',
			),
			array(            
					'name'=>'email',
			),
			array(
					'name'=>'type',
					'value'=> '$data->type==1?"Contact": ($data->type==2?"Datacards":($data->type==3 ? "Landing(DMA)":"Landing(Thanks Giving)"))',
			),
			array(            
					'name'=>'created',
					'value'=>'date("Y/j/m", strtotime($data->created))',
					'headerHtmlOptions'=>array('class'=>'desc'),
			),
			array(            // display a column with "view", "update" and "delete" buttons
					'class'=>'CButtonColumn',
					'template'=>'{View}{Delete}',
					'buttons'=>array
					(
							'View' => array
							(
									'imageUrl'=>Yii::app()->request->baseUrl.'/admin_assets/images/icon/color_18/zoom.png',
									'url'=>'Yii::app()->createUrl("admin/contact/view", array("id"=>$data->id))',
							),
							'Delete' => array
							(
									'imageUrl'=>Yii::app()->request->baseUrl.'/admin_assets/images/icon/color_18/close.png',
									'url'=>'Yii::app()->createUrl("admin/contact/delete", array("id"=>$data->id))',
									'options'=>array('name'=>'Contact Person', 'class'=>'Delete_contact'),
							),
					),
			),
			),
)); 
?>
<a class="uibutton special" id="Delete_user" name="delete" onclick="validateChk('contact', 'delete');">Delete</a>
</form>
</div></div>
<style type="text/css">
.button-column a img{
		width:164x;
		height:14px;
		margin:2px;
}
td, th{
	text-align:left;
}
</style>
<script type="text/javascript">

</script>
